package com.unience.ec2.eclipse.model;

import java.util.ArrayList;
import java.util.List;

import com.unience.aws.monitor.model.MonitorEc2Instance;
import com.xerox.amazonws.ec2.ReservationDescription.Instance;

public class Ec2Instance extends Model {
	protected static List newBooks = buildBookList();
	protected static int cursor = 0;
	
	private MonitorEc2Instance  ec2inst;
	
	public Ec2Instance(MonitorEc2Instance  ec2inst){
		super(ec2inst.getInstance().getInstanceId());
		
		this.ec2inst = ec2inst;
	}
	
	
	
	
	public static Ec2Instance newEc2Instance() {
		Ec2Instance newEc2Instance = (Ec2Instance)newBooks.get(cursor);
		cursor = ((cursor + 1) % newBooks.size());
		return newEc2Instance;
	}
	
	
	protected static List buildBookList() {
		newBooks = new ArrayList();
		
		
		
		return newBooks;
	}
	/*
	 * @see Model#accept(ModelVisitorI, Object)
	 */
	public void accept(IModelVisitor visitor, Object passAlongArgument) {
		visitor.visitEc2Instance(this, passAlongArgument);
	}




	public MonitorEc2Instance getEc2inst() {
		return ec2inst;
	}




	public void setEc2inst(MonitorEc2Instance ec2inst) {
		this.ec2inst = ec2inst;
	}

}
